Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLDB-1829 jseval rows #548

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

MLDB-1829 jseval rows #548

wants to merge 2 commits into from

Conversation

jeremybarnes
Copy link
Contributor

@jeremybarnes jeremybarnes commented Jul 20, 2016

  • Fixes crashes with JS contexts being mixed within jseval
  • Adds an ExpressionValue type to JS that mirrors the real one
  • Allows for arguments to be passed through in non-simplified form in jseval by adding a '!' to the variable names parameter, so that we can get full fidelity passing through jseval
  • Moved js out of soa and into plugins/lang/js, removing the last hooks of the generic code to JS

@jeremybarnes
Copy link
Contributor Author

Test failure is runner_test, which is completely unrelated and known spurious.

only un-nests by one level.

ExpressionValue objects are primarily used by the `jseval` function
with simplified arguments off.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a link to the description of simplified arguments.

@guyd
Copy link
Contributor

guyd commented Jul 20, 2016

+1 I reviewed briefly the code with only minor comments. I don't no the js code that well.

I agree with @FinchPowers that the exclamation mark might be confusing.

@FinchPowers
Copy link
Member

J'ai fait une expérience.

Dataset

{'rowName' : 'row1', 'columns' : [['x', 'data', 0]]

Requête

SELECT jseval('return row;', 'row', {*}) FROM ds

Résultat

2016-07-20 09:48:09.426 javascript [
   {
      "columns" : [
         [ "jseval('return row;', 'row', {*}).0.0.0", "x", "NaD" ],
         [ "jseval('return row;', 'row', {*}).0.1", "data", "NaD" ],
         [
            "jseval('return row;', 'row', {*}).0.2",
            {
               "ts" : "1970-01-01T00:00:00Z"
            },
            "NaD"
         ]
      ],
      "rowHash" : "86065feec3521acc",
      "rowName" : "row1"
   }
]

Il me semble que chaque colonne est explosée en 3, soit le nom, la valeur et la date. Est-ce bien ce que l'on souhaite?

Aussi, je pense que le nom de la première colonne est incorrect. Il devrait se terminer par ).0.0 et non pas par ).0.0.0

"jseval('return row;', 'row', {*}).0.0.0"
"jseval('return row;', 'row', {*}).0.1"
"jseval('return row;', 'row', {*}).0.2"

@jeremybarnes
Copy link
Contributor Author

@FinchPowers that behaviour is exactly the same as master; there is no change to the behaviour without an exclamation point. Structures are unfortunately broken out as [ [ key, [ value, ts ] ], ... ] and this behaviour is maintained to avoid breaking existing jseval scripts. If you use '!row' instead of 'row', you get much more reasonable behaviour, but I didn't want to break existing code and so you need to opt in using the '!'.

@FinchPowers
Copy link
Member

Merci pour l'explication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants